package main

import (
	"log"

	"github.com/AiGenApps/goout-server/database"
	"github.com/AiGenApps/goout-server/router"
)

func main() {
	// 初始化MongoDB连接
	if err := database.InitMongoDB(); err != nil {
		log.Fatal("MongoDB初始化失败:", err)
	}
	defer database.CloseMongoDB()

	// 设置路由
	r := router.SetupRouter()

	// 启动服务器
	log.Fatal(r.Run(":8092"))
}
